45. 跳跃游戏 II
https://leetcode-cn.com/problems/jump-game-ii/
func jump(nums []int) int {
postion := len(nums) - 1
step := 0
for postion > 0 {
for i := 0; i < postion; i++ {
// 当前的下标(剩余的距离)加上最远的能跳距离
if nums[i] + i >= postion {
postion = i
step++
break
}
}
}
return step
}